package com.itheima.health.dao;

import com.github.pagehelper.Page;
import com.itheima.health.pojo.CheckGroup;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface CheckGroupDao {

    Page<CheckGroup> Page(String queryString);

    void insert(CheckGroup checkGroup);


    @Select("select id from t_checkgroup where code =#{code}")
    Integer getid(String code);

    @Delete("delete from t_checkgroup where id =#{id}")
    void deleteById(Integer id);




    @Select("select * from t_checkgroup where id =#{id}")
    CheckGroup findById(Integer id);

    List<Integer> findCheckItemIdsByCheckGroupId(Integer id);

    void deleteAssociation(Integer id);

    void edit(CheckGroup checkGroup);

    void setCheckGroupAndCheckItem(Map<String, Integer> map);

    List<CheckGroup> findAll();
}
